package tool.code.generater.config;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import tool.code.generater.util.CommonUtil;

import java.util.LinkedHashMap;
import java.util.Map;

@Data
public class TemplateConfig {
    private String baseTemplatePath;
    private String baseOutputPath;
    private String basePackage;
    private String moduleName;
    /**
     * 模式:create,update,remove
     */
    private String mode;
    private Map<String, String> templateOutputMap = new LinkedHashMap<>();


    public String getCustomBasePackage() {
        if (StringUtils.isNotEmpty(basePackage)) {
            return basePackage;
        }
        return CommonUtil.extractBasePackage(baseOutputPath);
    }
}
